<script src="/assets/js/smartpaginator.js" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$('#category').smartpaginator({ totalrecords: <?php echo count($category_list); ?>, recordsperpage: 10, datacontainer: 'category_table', dataelement: 'tr', initval: 0, next: 'Next', prev: 'Prev', first: 'First', last: 'Last', theme: 'green' });
	});
</script>   
<div id="category" style="margin: auto;"> </div>
<table id="category_table">
      <thead>
        <tr>
          <th>id</th>
          <th>类别名</th>
          <th>图</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <?php
	foreach($category_list as $category)
	{
?>
        <tr id="DemoGrid">
          <td><?php echo $category->id; ?></td>
          <td><?php echo $category->name; ?></td>
          <td><a href="/book/category/image?category_id=<?php echo $category->id; ?>" target="_blank"> <img src="/book/category/image?category_id=<?php echo $category->id; ?>"></a> </td>
          <td><a href="/admin/category/delete/<?php echo $category->id; ?>" onClick="var bl=confirm('真要删除?'); if(bl){return true;} else {return false;}" class="rates_button">删除</a> <a target="_blank" href="/admin/category/modify/<?php echo $category->id; ?>" class="rates_button">编辑</a> </td>
        </tr>
        <?php
	}
?>
      </tbody>
    </table>
